<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/10/18 0018
 * Time: 16:38
 */

namespace Admin\Controller;

class AdcertisingClassController extends CommonController{

    public function index(){

        $result = M('adverti_class')->where(array('state'=>1))->select();

            $this->assign('list',$result);

        $this->display('Advertising/classIndex');
    }

    public function add(){
        if(IS_POST) {
            $data = I('post.');

            $rel =  M('adverti_class')->add($data);

            if($rel){
                die(json_encode(array('state'=>'200','rel' => '成功！')));
            }

        }
        $this->display('Advertising/classadd');
    }
}